package cn.myjerry.io.others;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * PrintStream 打印流 --> 处理流
 * @author Jerry
 *
 */

public class PrintStreamDemo01 {
	public static void main(String[] args) throws FileNotFoundException {
		System.out.println("test");
		PrintStream ps = System.out;
		ps.println(false);
		
		// 输出到文件
		File dest = new File("/Users/zpon/Desktop/test04.txt");
		ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(dest)));
		ps.println("my name is Jerry");
		ps.flush();
		ps.close();
	}
}
